<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/5.10.0-11/css/all.css">
    <link rel="stylesheet" href="css/bt.css">
    <title>Document</title>
</head>
<body>
    <nav class="nav nav-fix">
        <div class="container clearfix">
            <div class="nav-header clearfix">
                <h2>Bootstrap 中文网</h2>
                <a href="javascript:void(0)" class="toggle">
                    <i class="fa fa-bars toggle-btn"></i>
                </a>
            </div>
            <div class="nav-list">
                <ul>
                    <li>
                        <a href="#">起步</a>
                    </li>
                    <li class="hidden">
                        <a href="#">全局css样式</a>
                    </li>
                    <li>
                        <a href="#">组件</a>
                    </li>
                    <li>
                        <a href="#">javascript插件</a>
                    </li>
                    <li> 
                        <a href="#">定制</a>
                    </li>
                    <li> 
                        <a href="#">网站实例</a>
                    </li> 
                </ul>
                <ul class="navbar-right">
                    <li>
                        <a href="#">关于</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    <div class="container">
        <div class="bg_img"></div>  
    </div>
</body>
<script>
    const toggle = document.getElementsByClassName('toggle')[0]
    const navList = document.getElementsByClassName('nav-list')[0]
    let isBool = true
    toggle.addEventListener('click', () => {
        if(isBool) {
            navList.className = 'nav-list active'
        } else {
            navList.className = 'nav-list hidden'
        }
        isBool = !isBool
    })
</script>
</html>